﻿using Infrastructure.ElasticSearch.Enums;
using System;
using System.Linq.Expressions;

namespace Infrastructure.ElasticSearch.Nests
{
    public class ElasticSearchSort<T> where T : class
    {
        private Expression<Func<T, object>> _field;
        private QueryOrderTypeEnum _order;

        public Expression<Func<T, object>> Field { get { return _field; } }
        public QueryOrderTypeEnum Order { get { return _order; } }
        public ElasticSearchSort(Expression<Func<T, object>> field, QueryOrderTypeEnum order = QueryOrderTypeEnum.Asc)
        {
            _field = field;
            _order = order;
        }
    }
}
